/**
 * 
 */
package net.cloudcodex.client.character.view;

import java.util.Map;

import net.cloudcodex.client.character.view.CharactersView.Message;
import net.cloudcodex.client.character.view.panel.CharacterSheetDescriptionPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.dom.client.HasKeyDownHandlers;
import com.google.gwt.event.dom.client.HasKeyUpHandlers;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.inject.Inject;

/**
 * @author dweltz
 * 
 */
public class CharacterDescriptionViewImpl extends ScrollPanel implements
		CharacterDescriptionView {

	final private FlowPanel innerpanel = new FlowPanel();
	final CharacterSheetDescriptionPanel characterDescriptionPanel = new CharacterSheetDescriptionPanel();

	@Inject
	public CharacterDescriptionViewImpl(Message message) {
		innerpanel.add(characterDescriptionPanel);
		this.add(innerpanel);
		characterDescriptionPanel.addMessage(message);
	}

	@Override
	public void setOwner(boolean isOwner) {
		characterDescriptionPanel.setOwner(isOwner);
	}

	@Override
	public void setGameMaster(boolean isGameMaster) {
		characterDescriptionPanel.setGameMaster(isGameMaster);

	}

	@Override
	public HasClickHandlers getPopupCancelButton() {
		return characterDescriptionPanel.getPopupCancelButton();

	}

	@Override
	public void initPopupCancelButton() {
		characterDescriptionPanel.initPopupCancelButton();

	}

	@Override
	public void initUpdateCharacterButton() {
		characterDescriptionPanel.initUpdateCharacterButton();
	}

	@Override
	public void clearButtonPanel() {
		characterDescriptionPanel.clearButtonPanel();

	}

	@Override
	public void setUpdateCharacterNotesButtonEnable(boolean enable) {
		characterDescriptionPanel.setUpdateCharacterNotesButtonEnable(enable);
	}

	@Override
	public HasClickHandlers getUpdateCharacterNotesButton() {
		return characterDescriptionPanel.getUpdateCharacterButton();
	}

	@Override
	public void addCharacter(long id, String icon, String name) {
		characterDescriptionPanel.addCharacter(id, icon, name);
	}

	@Override
	public void addCharacterAliases(Map<Long, String> aliases) {
		characterDescriptionPanel.addAliases(aliases);

	}

	@Override
	public void addCharacterPublicDescriptions(String description) {
		characterDescriptionPanel.addCharacterPublicDescription(description);

	}

	@Override
	public void addCharacterPrivateDescriptions(String description) {
		characterDescriptionPanel.addCharacterPrivateDescription(description);

	}

	@Override
	public void addPersonalNote(CharactersNoteView charactersNoteView) {
		characterDescriptionPanel.addPersonalNote(charactersNoteView);

	}

	@Override
	public void addPlayersNote(CharactersNoteView charactersNoteView) {
		characterDescriptionPanel.addPlayersNote(charactersNoteView);

	}

	@Override
	public void initComponent() {
		characterDescriptionPanel.initComponent();
	}

	@Override
	public HasKeyDownHandlers getPrivateDescriptionPanelKeyDownHandlers() {
		return characterDescriptionPanel
				.getPrivateDescriptionPanelKeyDownHandlers();
	}

	@Override
	public HasKeyUpHandlers getPrivateDescriptionPanelKeyUpHandlers() {
		return characterDescriptionPanel
				.getPrivateDescriptionPanelKeyUpHandlers();
	}

	@Override
	public HasKeyDownHandlers getPublicDescriptionPanelKeyDownHandlers() {
		return characterDescriptionPanel
				.getPublicDescriptionPanelKeyDownHandlers();
	}

	@Override
	public HasKeyUpHandlers getPublicDescriptionPanelKeyUpHandlers() {
		return characterDescriptionPanel
				.getPublicDescriptionPanelKeyUpHandlers();
	}

	@Override
	public String getChangedPublicDescription() {
		// TODO Auto-generated method stub
		return characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getChangedPublicDescription();
	}

	@Override
	public String getChangedPrivateDescription() {
		// TODO Auto-generated method stub
		return characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getChangedPrivateDescription();
	}

	@Override
	public Map<Long, String> getAliases() {
		return characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getAliases();
	}

	@Override
	public void refreshPrivateDescriptions(String privateDescription) {
		characterDescriptionPanel
				.refreshPrivateDescriptions(privateDescription);
	}

	@Override
	public void refreshPublicDescriptions(String publicDescription) {
		characterDescriptionPanel.refreshPublicDescriptions(publicDescription);
	}

	@Override
	public void setOwnerId(Long ownerId) {
		characterDescriptionPanel.setOwnerId(ownerId);
	}

	@Override
	public void addCharacterAdvancedInfos(boolean isProfile, boolean isLocked,
			boolean isDead) {
		this.characterDescriptionPanel.addCharacterAdvancedInfos(isProfile,
				isLocked, isDead);
	}

	@Override
	public void isActive(boolean isActive) {
		this.characterDescriptionPanel.isActive(isActive);
	}

	@Override
	public HasKeyDownHandlers getNameTextBoxKeyDownHandlers() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getNameTextBox();
	}

	@Override
	public HasKeyUpHandlers getNameTextBoxKeyUpHandlers() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getNameTextBox();
	}

	@Override
	public HasKeyDownHandlers getIconTextBoxKeyDownHandlers() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getIconTextBox();
	}

	@Override
	public HasKeyUpHandlers getIconTextBoxKeyUpHandlers() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getIconTextBox();
	}

	@Override
	public HasValueChangeHandlers<Boolean> getProfileCheckBox() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getProfileCheckBox();
	}

	@Override
	public HasValueChangeHandlers<Boolean> getLockedCheckBox() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getLockedCheckBox();
	}

	@Override
	public HasValueChangeHandlers<Boolean> getDeadCheckBox() {
		return this.characterDescriptionPanel.getCharacterSheetInfosPanel()
				.getDeadCheckBox();
	}
	
	@Override
	public void addCancelButton(Button cancelButton) {
		characterDescriptionPanel.addCancelButton(cancelButton);

	}

	@Override
	public Boolean isDead() {
		return characterDescriptionPanel.isDead();
	}

	@Override
	public Boolean isLocked() {
		return characterDescriptionPanel.isLocked();
	}
	
}
